import time

from fastapi import FastAPI, middleware, Request, Response, Body
from nation.app import api as nationApi
# from sys.app import api as sysApi
# from industry.app import api as industryApi
import uvicorn

app = FastAPI()

app.include_router(nationApi, prefix="/nation", tags=["国家管理"])
# app.include_router(sysApi, prefix="/sys", tags=["用户管理"])
# app.include_router(industryApi, prefix="/industry", tags=["工业管理"])


# @app.middleware("http")
# async def add_process_time_header(request: Request, call_next):
#     start_time = time.time()
#     response = await call_next(request)
#     process_time = time.time() - start_time
#     response.headers["X-Process-Time"] = str(process_time)
#     return response


if __name__ == '__main__':
    uvicorn.run("main:app", port=8000, reload=True)
